<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link type="text/css" rel="stylesheet" href="/semantic/dist/semantic.min.css">

    <script src="/node_modules/jquery/dist/jquery.min.js"></script>
    <script src="/semantic/dist/semantic.min.js"></script>
    <script src="/node_modules/art-template/lib/template-web.js"></script>

    <link type="text/css" rel="stylesheet" href="./index.css">
    <script src="./index.js"></script>
</head>

<body>
    <h1>英雄列表</h1>
    <button class="ui primary button" id="add">添加英雄</button>

    <!-- 表格区域 -->
    <table class="ui celled striped red table">
        <thead>
            <tr>
                <th>编号</th>
                <th>英雄名称</th>
                <th>性别</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody id="tbd">
            <!-- <tr>
                <td data-label="Name">James</td>
                <td data-label="Age">24</td>
                <td data-label="Job">Engineer</td>
                <td data-label="Job">Engineer</td>
                <td data-label="Job">Engineer</td>
            </tr> -->

        </tbody>
    </table>

    <!-- 对话框 -->
    <div class="ui tiny modal">
        <div class="header">
            添加新英雄
        </div>
        <div class="content">
            <form class="ui form">
                <div class="field">
                    <label>名称：</label>
                    <input type="text" name="name" placeholder="请输入英雄名称">
                </div>
                <div class="field">
                    <label>性别：</label>
                    <select name="gender" class="ui fluid dropdown">
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
            </form>
        </div>
        <div class="actions">
            <div class="ui black deny button">
                取消
            </div>
            <div class="ui positive right button" id="btnAdd">
                添加
            </div>
        </div>
    </div>
</body>
<script type="text/templaye" id="row">
    {{each  data}}
        <tr>
            <td data-label="Name"> 
                <div class="ui ribbon label {{$value.isdel === 0 ? 'blue' : 'red'}}">{{$value.isdel === 0 ? '正常' : '删除'}}</div>
            </td>
            <td data-label="Age">{{$value.name}}</td>
            <td data-label="Age">{{$value.gender}}</td>
            <td data-label="Age">{{$value.ctime}}</td>
            <td data-label="Age">
                <a>编辑</a>
                <a>删除</a>
            </td>
        </tr>
    {{/each}}
</script>

</html>